Skip to content

feat: dedicated database connection per package - #11

Merged
jayjfletcher merged 1 commit into
mainfrom
feat/package-db-connection
Nov 9, 2026
Merged

jayjfletcher merged 1 commit into
mainfrom
feat/package-db-connection

Conversation

@jayjfletcher

Copy link
Copy Markdown
Member

Summary

  • Database\Tables::connection() reads {key}.database.connection (null/empty = app default; override key via CONNECTION).
  • Tables::db(): the package connection for raw queries, schema checks and transactions.
  • Tables::qualified($key): {connection}.{table} for exists/unique rules.
  • Testing\Arch::defaultConnectionUses(): flags DB:: facade calls and injected ConnectionInterface/DatabaseManager/ConnectionResolverInterface.
  • README + CHANGELOG document the model (getConnectionName()) and migration (getConnection()) wiring.

Packages adopt it in follow-up Ring Master jobs once this merges. Companion standards PR in refactor-circus/standards.

Test plan

  • composer test (pest 87 passed, phpstan, pint)

🤖 Generated with Claude Code

Tables::connection() reads {key}.database.connection (null keeps the app
default); Tables::db() and Tables::qualified() route raw queries,
transactions and validation rules through it. Arch::defaultConnectionUses()
finds code still reaching the default connection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayjfletcher
jayjfletcher merged commit f689b14 into main Nov 9, 2026
4 checks passed
@jayjfletcher
jayjfletcher deleted the feat/package-db-connection branch November 11, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant